<script setup>
import {ref} from "vue";

let auditLogTableData = ref([
  {
    username: "管理员",
    operation: "登录",
    ip: "0.0.0.0",
    status: "success",
    sort: 0,
  },
  {
    username: "管理员",
    operation: "创建用户",
    ip: "0.0.0.0",
    status: "success",
    sort: 0,
  },
  {
    username: "管理员",
    operation: "修改用户",
    ip: "0.0.0.0",
    status: "success",
    sort: 0,
  },
  {
    username: "管理员",
    operation: "删除用户",
    ip: "0.0.0.0",
    status: "fail",
    sort: 0,
  },
  {
    username: "管理员",
    operation: "注销",
    ip: "0.0.0.0",
    status: "success",
    sort: 0,
  },
])
</script>

<template>
  <div style="display: flex; flex-flow: column nowrap; width: 100%; height: 100%; overflow: hidden;">
    <div style="display: flex; flex-flow: row nowrap; align-items: center; height: 40px;">
      <el-form :inline="true" style="height: 30px">
        <el-form-item label="Name">
          <el-input clearable/>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="handleDictList">Search</el-button>
          <el-button type="primary" @click="handleDictCreate({})">New</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div style="display: flex; width: 100%; height: 100%; overflow: auto;">
      <el-table
          highlight-current-row
          @row-click="handleDictTableRowClick"
          :data="auditLogTableData" border style="width: 100%;">
        <el-table-column prop="username" label="username" min-width="100"/>
        <el-table-column prop="operation" label="operation" width="170" />
        <el-table-column prop="ip" label="ip" width="170" />
        <el-table-column prop="status" label="status" width="100" />
        <el-table-column prop="sort" label="sort" width="60"/>
        <el-table-column label="operations" width="100">
          <template #default="scope">
            <el-button @click="handleEdit(scope.$index, scope.row)">
              详情
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div style="flex: none; display: flex; flex-flow: row nowrap; align-items: center; height: 36px; border-top: #5cadff 1px solid;">
      <el-pagination layout="total, sizes, prev, pager, next, jumper" :total="1000"/>
    </div>
  </div>
</template>

<style scoped>

</style>